from django.shortcuts import render,HttpResponse,get_object_or_404
import datetime


from ..models import  inter
import logging
logger = logging.getLogger(__name__)


# def inter(request):
#
#     obj = inter.objects.all()
#
#     return render(request,"inter.html",{"obj":obj})


def inter(request):
    try:
        obj = inter.objects.all()
        user_id = request.user.id
        access_time = datetime.now()
        logger.info('User %s accessed the page at %s', user_id, access_time)
        return render(request,"inter.html",{"obj":obj})
    except Exception as e:
        error_type = type(e).__name__
        error_message = str(e)
        logger.error('Error occurred: %s - %s', error_type, error_message)

